#ifndef IMMANAGER_H
#define IMMANAGER_H

#include <QObject>
#include <QDebug>
#include <src/singleton.h>
#include <QTimer>
#include <src/stdafx.h>
#include "src/session.h"
#include "src/message.h"
#include <QDateTime>
#include "src/protocol/Packet.hpp"

class IMCallback: public QObject{
    Q_OBJECT
public:
    explicit IMCallback(QObject *parent = nullptr){};
    ~IMCallback(){};
};

class IMManager : public QObject
{
    Q_OBJECT
public:
    SINGLETONG(IMManager)
    Q_SIGNAL void sessionChanged(QList<Session> data);
private:
    explicit IMManager(QObject *parent = nullptr);
    ~IMManager();
    QList<Session> getSessionList();
    void updateSession(Session session);
    Session message2session(const Message& val);
};
#endif // IMMANAGER_H
